{% extends 'base.html' %}

{% block title %}文章归档{% endblock %}

{% block content %}
<div class="container">
    <div class="row">
        <div class="col-md-8 offset-md-2 bg-white p-4">
            <h3>{{ view.kwargs.date }}的文章({{ page_obj.paginator.count }}): </h3>
            <hr>
            {% for post in post_list %}
            <div class="media">
                <div class="media-body">
                    <h4><a class="text-decoration-none text-weight-bold text-dark" href="{{ post.get_absolute_url }}">{{ post.title }}</a></h4>
                    <a class="text-decoration-none font-weight-bold text-secondary"
                       href="{% url 'blog:user_posts' username=post.user.username %}">{{ post.user.username }}</a>
                    <small class="text-muted">发布于{{ post.date_created | date:"Y-m-d H:i" }}</small>
                </div>
            </div>
            <hr>
            {% empty %}
            <p class="text-muted">还没有文章...</p>
            {% endfor %}

            {% include 'blog/_pagination.html' %}
        </div>
    </div>
</div>
{% endblock %}


